eostitan / delphioracle

40 stars 38 forks source link

EOS_CHAIN? #12

Closed ekkis closed 4 years ago

ekkis commented 4 years ago

I've done the install in scripts/ but in looking at the .env I need to replace some values. what do I use for EOS_CHAIN when I'm running against localhost?

ekkis commented 4 years ago

I read somewhere that ChainId no longer has to be provided to eosjs because it will determine it from the endpoint. so I erased the value, then proceeded to run the updater script:

~/dev/eos/delphioracle/scripts $ node updater.js 

and got this:

EOSUSD: 2.477 EOSBTC: 0.0003445 BTCUSD: 7176.26 BTCUSD: 9468 BTCCNY: 50159.68 quotes: [ { value: 24770, pair: 'eosusd' } ]

but it hung up (never returned control) and if I query the table:

cleos get table --limit 100 delphioracle eosusd datapoints

I don't see any values:

{ "rows": [], "more": false }

sigh... help?

systemzax commented 4 years ago

The chain_id is required to interact with any EOSIO chain, as part of the signature generation process. It is created based on the initial genesis.json parameters supplied when a chain is launched.

Here are a few chain_ids of interest:

EOS Mainnet: aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 Jungle Testnet: e70aaab8997e1dfce58fbfac80cbbb8fecec7b99cf982a9444273cbc64c41473 CrytoKylin Testnet: 5fff1dae8dc8e2fc4d5b23b2c7665c97f9e9d8edf2b6485a86ba311c25639191

systemzax commented 4 years ago

If you launched your own testnet / chain for development purposes, you can use:

 cleos get info

Results:

{
  "server_version": "f545d4e5",
  "chain_id": "5fff1dae8dc8e2fc4d5b23b2c7665c97f9e9d8edf2b6485a86ba311c25639191",
  "head_block_num": 82392035,
  "last_irreversible_block_num": 82391708,
  "last_irreversible_block_id": "04e9329c67f711901d28000ac90c08228b5295d905f47778c6b0f78251ff1134",
  "head_block_id": "04e933e3d6d163c734adbd11f3d15d5ee8e59911c42476f2b75d696c70e7a1ab",
  "head_block_time": "2019-12-21T16:22:49.500",
  "head_block_producer": "alohaeostes2",
  "virtual_block_cpu_limit": 250000000,
  "virtual_block_net_limit": 524288000,
  "block_cpu_limit": 249800,
  "block_net_limit": 524240,
  "server_version_string": "v1.8.7",
  "fork_db_head_block_num": 82392035,
  "fork_db_head_block_id": "04e933e3d6d163c734adbd11f3d15d5ee8e59911c42476f2b75d696c70e7a1ab"
}
ekkis commented 4 years ago

ah! that last post clears it. a million thanks