Sign inSign up

williambnorton/multichain

By williambnorton

Updated about 2 years ago

A simple docker run to get blockchain data. Requires ACCESS_TOKEN from https://portal.synternet.com/

Image
Developer tools
0

387

williambnorton/multichain repository overview

I share this docker and run commands at the bottom with my fellow Synternet web3 dApp developers as an easy way to peruse and process Synternet blockchain data on your mac in simple text format and all the unix tools and filters already on your mac.

Uses of this docker:

  1. using stdout from the docker piped into standard mac/unix cli tools and filters like jq to pull out blockchain fields from transactions, and awk, sed, etc. to massage the data into a format that can be used in other contexts. For stepwise refinement, this is a fun way to view and play with the data.

  2. entering the docker bash shell (docker run -it ... williambnorton/multichain /bin/bash) and using the symlinked files inside to browse the data channels also allows you to browse the data streams available. Here you can type ./synternet.ethereum. to see the data streams available with the synternet.ethereum.* data streams. These files are symbolic links to a bash script that connects to the Synternet data layer and prints out the data in the docker.

  3. using the rust development environment in the docker to refine the code to your liking. You can edit the embedded synternet example code in the docker and do what you want!

Assuming that you have subscribed and applied AMBER to the data streams on the portal, you can access them on your mac in these three ways.

A) docker examples that send data out stdout to your screen: (assuming you did an export ACCESS_TOKEN=)

docker run --init -eSUBJECT=synternet.solana.tx -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.ethereum.tx -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.prices.single.ETH -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.ethereum.mempool -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

While you could use grep to pull out a line with the field you want ("gasPrice" from the synternet.ethereum.tx data feed for example) as in

docker run --init -eSUBJECT=synternet.ethereum.tx -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain | grep gasPrice

"gasPrice": 22669512420, "gasPrice": 22669512420, "gasPrice": 22669512420, : it is more flexible to force each JSON block to show up as a single line and chop it up using jq or some such filter by setting the PIPED environmental variable on the command line:

docker run --init -ePIPED=1 -eSUBJECT=synternet.ethereum.tx -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain | jq '.gasPrice'

95716535619 89716535619 52422490393

Note: you may need to install jq using homebrew or the equivalent on your mac

B) A second way to peruse the subscribed Synternet blockchain data streams is to go inside the docker and use my symbolically linked scripts in the docker:

docker run --init -ePIPED=1 -eSUBJECT=synternet.ethereum.tx -eACCESS_TOKEN=$ACCESS_TOKEN -it williambnorton/multichain /bin/bash

Now that you are inside the docker, you can use 'ls' to see the data streams as executable scripts, or use unix file completion (type synternet.price. to see the data streams available.)

root@96c678c9574a:/usr/src/multichain# ls synternet.price.

synternet.price.all synternet.price.single.ETH synternet.price.single.stATOM synternet.price.single.AKT synternet.price.single.INJ synternet.price.telemetry

:

The docker will re-build the rust code base (this is a rust dev environment for you to play with!) and if you have a funded subscribed channel, it will show the data flows.

 :

ls synternet.price.all

{"AKT":{"last_updated":1718643120,"price":2.975590305427061,"price_percent_change_24h":-11.95531968},"ATOM":{"last_updated":1718643120,"price":7.006739688934988,"price_percent_change_24h":-2.90290596},"ETH":{"last_updated":1718643120,"price":3526.325699496796,"price_percent_change_24h":-1.84863435},"INJ":{"last_updated":1718643120,"price":21.906745005157735,"price_percent_change_24h":-12.48516847},"OSMO":{"last_updated":1718643120,"price":0.5701162069073518,"price_percent_change_24h":-5.80749108},"PICA":{"last_updated":1718643120,"price":0.001934260492221087,"price_percent_change_24h":-14.78630287},"TIA":{"last_updated":1718643180,"price":7.424853461025817,"price_percent_change_24h":-5.91852273},"USDC":{"last_updated":1718643120,"price":1.0000507397829674,"price_percent_change_24h":0.00276184},"USDT":{"last_updated":1718643120,"price":0.9994320531025348,"price_percent_change_24h":0.00550115},"WBTC":{"last_updated":1718643120,"price":65865.7242760303,"price_percent_change_24h":-1.17977739},"axlUSDC":{"last_updated":1718643120,"price":1.0001029390082687,"price_percent_change_24h":0.02030493},"stATOM":{"last_updated":1718643120,"price":9.585392943110296,"price_percent_change_24h":-2.52184471}}

C) One last way for rust programmers is to extend the rust code provided by the Synternet project in the docker. Since the docker is built upon the rust development docker, the rust code can be modified and rebuilt for whatever purpose you like.

I hope this helps.

Bill

Prerequisites IMPORTANT - Three steps are required to get the Synternet data streams as I have done.

  1. Install the keplr digital wallet (free: https://www.keplr.app/). This will hold your "AMBER tokens" allowing access to the Synternet data layer blockchain test network.

  2. Connect your keplr digital wallet to the Synternet data layer (free:https://portal.synternet.com/). Create a project on the data layer portal and click on "Get 10 AMBER tokens" to load your wallet with some tokens, the economic energy to drive the blockchain. Apply tokens to the data streams (https://portal.synternet.com/subscribe/) you might want to access. I typcically apply 2 AMBER typically to get started.

  3. Get a copy of your "ACCESS_TOKEN" by clicking on the ... button to the right of your project. Set this as an environmental variable $ACCESS_TOKEN :

export ACCESS_TOKEN=SAACGDDIWQ4M75EVSSBG2DYFHSGGZPXJ2F6AOISHGR6KFWHKCHCIS...

Set this in your ACCESS_TOKEN environmental variable so you can type the simple docker run examples below. I set ACCESS_TOKEN in my .zshrc on my mac.

For convenience, here are some of the current data streams as docker run commands. (make sure you subscribed on the data portal, set $ACCESS_TOKEN and have tokens attached to the data layers of interest).

If you get an error message running the docker commands, echo $ACCESS_TOKEN because you probably didn't set it.

APTOS Blockchain: https://aptosfoundation.org/ecosystem/projects/all Glossary: https://aptos.dev/reference/glossary/ Technical docs: https://aptos.dev/concepts/blockchain/ blockchain explorer: https://explorer.aptoslabs.com/?network=mainnet

docker run --init -eSUBJECT=synternet.aptos.mainnet.tx -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

Arbitrum Blockchain: https://arbitrum.io/ Blockchain explorer: https://arbiscan.io/ Glossary: https://docs.arbitrum.io/intro/glossary articles: https://docs.arbitrum.io/build-decentralized-apps/public-chains https://officercia.mirror.xyz/d798TVQyA1ALq3qr1R9vvujdF7x-erXxK2wQWwbgRKY

docker run --init -eSUBJECT=synternet.arbitrum.block -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.arbitrum.header -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.arbitrum.log-event -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.arbitrum.trace_cal -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.arbitrum.tx -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

base blockchain : onchain home for Coinbase products https://www.base.org/ Block Explorer: https://base.blockscout.com/ Article: https://medium.com/3x-capital/intro-guide-base-ecosystem-0c27cf602d12

docker run --init -eSUBJECT=synternet.base.block -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.base.header -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.base.log-event -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.base.trace_call -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.base.tx -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

Bitcoin blockchain - https://bitcoin.org/en/ Glossary: https://bitcoin.org/en/vocabulary#bitcoin https://www.ussc.gov/sites/default/files/pdf/training/annual-national-training-seminar/2018-materials/emerging-tech_glossary-crypto.pdf Blockchain Explorer: https://www.blockchain.com/explorer articles: https://www.oreilly.com/library/view/mastering-bitcoin/9781491902639/ch07.html https://medium.com/coinmonks/structure-of-a-bitcoin-block-7f6c4938a5fd

docker run --init -eSUBJECT=synternet.bitcoin.block -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.bitcoin.nft -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.bitcoin.sequence -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.bitcoin.transfer.0_5 -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.bitcoin.tx -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

dydx ecosystem https://dydx.exchange/ Blockchain Explorer: https://dydx.explorers.guru/ https://www.mintscan.io/dydx https://docs.dydx.exchange/concepts-architecture/architectural_overview Article: https://weareblox.com/en-eu/dydx

docker run --init -eSUBJECT=synternet.dydx.block -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.dydx.mempool -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.dydx.tx -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

Ethereum https://ethereum.org/en/ DevDocs: https://ethereum.org/en/developers/docs/ https://medium.com/@eiki1212/ethereum-transaction-structure-explained-aa5a94182ad6 https://ipld.io/specs/codecs/dag-eth/chain/ https://openethereum.github.io/Chain-specification

docker run --init -eSUBJECT=synternet.ethereum.block -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.ethereum.header -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.ethereum.log-event -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.ethereum.mempool -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.ethereum.trace_call -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.ethereum.tx -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

injective finance blockchain https://injective.com/ Blockchain Explorer: https://explorer.injective.network/ Glossary: https://docs.injective.network/learn/glossary/ Articles: https://medium.com/@0xtega/what-is-injective-your-one-stop-guide-to-injective-16380732edfd https://medium.com/@ifennakenneth55/demystifying-key-terms-in-the-world-of-injective-unveiling-the-core-elements-and-ecosystem-9465138ae5bf https://docs.injective.network/learn/basic-concepts/gas_and_fees/

docker run --init -eSUBJECT=synternet.injective.block -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.injective.mempool -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.injective.proposed_block -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.injective.tx -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

Oasis privacy protocol https://oasisprotocol.org/ Blockchain Explorer: https://www.oasisscan.com/ Glossary: https://docs.oasys.games/docs/staking/glossary/1-1-glossary Articles: https://docs.oasis.io/general/oasis-network/ https://medium.com/oasis-protocol-project/10-things-you-need-to-know-about-the-oasis-network-51df802f6c9f https://docs.oasis.io/general/manage-tokens/cli/network/

docker run --init -eSUBJECT=synternet.oasis.emerald.accounts -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.oasis.emerald.blocks -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.oasis.emerald.consensus_accounts -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.oasis.emerald.contract -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.oasis.emerald.core" -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.oasis.emerald.evm -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.oasis.sapphire.accounts -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.oasis.sapphire.blocks -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.oasis.sapphire.consensus_accounts -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.oasis.sapphire.contracts -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.oasis.sapphire.core -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.oasis.sapphire.evm -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

osmosis DEX https://osmosis.zone/ https://docs.osmosis.zone/osmosis-core/guides/structure/

docker run --init -eSUBJECT=synternet.osmosis.block -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.osmosis.dashboard.pool -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.osmosis.mempool -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.osmosis.state.pools -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.osmosis.swap -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.osmosis.telemetry -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.osmosis.tx -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.osmosis.volume.pool -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

peaq dePin blockchain https://www.peaq.network/ Glossary: https://docs.peaq.network/docs/learn/glossary/ Articles: https://medium.com/oneblock-community/how-does-depin-star-peaq-network-build-a-new-web3-iot-083747ac3e74

docker run --init -eSUBJECT=synternet.peaq.balances.transfer -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.peaq.block -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.peaq.peaq-storage.item-added -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.peaq.peaq-storage.item-read -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.peaq.peaq-storage.item-updated -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.peaq.telemetry -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

polkadot interoperability blockchain https://polkadot.network/ Blockchain Explorer: https://www.statescan.io/ https://polkadot.subscan.io/ Glossary: https://wiki.polkadot.network/docs/glossary https://medium.com/@CryptoZameer/exploring-the-potential-of-polkadot-blockchain-9be84b353654 https://www.leewayhertz.com/what-is-polkadot-network/#How-does-the-Polkadot-Network-Function?

docker run --init -eSUBJECT=synternet.polkadot.balances.transfer -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.polkadot.block -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.polkadot.telemetry -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

synternet published price quotes for tokens Blockchain Explorer: https://explorer.synternet.com/ Articles: https://medium.com/@burnspkaxtflgp/synternet-staking-quick-guide-for-beginners-to-earn-passive-income-cdb91cbde169

docker run --init -eSUBJECT=synternet.price.all -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.price.single.AKT -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.price.single.ATOM -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.price.single.ETH -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.price.single.INJ -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.price.single.OSMO -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.price.single.PICA -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.price.single.TIA -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.price.single.USDC -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.price.single.USDT -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.price.single.WBTC -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.price.single.axlUSDC -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.price.single.stATOM -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.price.telemetry -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

Solana blockchain https://solana.com/ Blockchain Explorer: https://explorer.solana.com/ https://solscan.io/ https://www.oklink.com/sol Glossary: https://solana.com/docs/terminology https://solana.com/docs/core/accounts https://www.investopedia.com/solana-5210472 https://www.zeeve.io/blog/a-complete-guide-on-solana-blockchain-and-its-use-cases/ https://www.forbes.com/advisor/investing/cryptocurrency/what-is-solana/

docker run --init -eSUBJECT=synternet.solana.account -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.solana.block -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.solana.entry -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.solana.nft -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.solana.slot -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

docker run --init -eSUBJECT=synternet.solana.tx -eACCESS_TOKEN=$ACCESS_TOKEN williambnorton/multichain

Notes:

  1. All SUBJECT environmental variables are case-sensitive. So, synternet.ethereum.Tx and synternet.prices.single.eth will silently deliver nothing.

  2. You can also set the NATS_SERVER environmental variable using the -eNATS_SERVER=

  3. The docker is based on rust:latest so you have a rust development environment to play in. Once in the docker, you can use vim to edit rust code and jq to use in your bash script. The firt cargo run will build all and the subsequent ones will only recompile the changed code. If you want to play with rust instead of using scripting, this is a great first project playspace!

Tag summary

Content type

Image

Digest

sha256:9c1298ee1

Size

717.9 MB

Last updated

about 2 years ago

docker pull williambnorton/multichain