Skip to content

Instantly share code, notes, and snippets.

{
"nodes": [
{ "url": "enode://ad0f88638e5e4621cec5632e01d13710ee4a83512a4b828b24d7ef63bbe9238ec1f178ef8fda007281761e5da3709d6c7992f526945003e24d9bd02f414d7122@78.46.49.102:30304", "failures": 0 },
{ "url": "enode://a717d29e78ffd3c9dce0186257d83fb65bdb9289b317e9e5388d7497a9ff347693a081dea9dcc83334f824f98d6bf926bac9d47153e14f861c6d8b807ab20019@76.184.243.139:30303", "failures": 0 },
{ "url": "enode://6b253139c44aa20b233d68e69922c6d3bccc294b6a5619d416186edab13504a589f941222283d6537d06f0752bc3b79c4c2200bf91cd7b28adcf9b05e754f0e6@198.199.90.70:30303", "failures": 0 },
{ "url": "enode://5b529eb4e451de88eb9442d9963e88740632077ec19a364cafecb059031c4632bd5aaec67389efb2ad7487a014f987b760a899dc6f6cd4190d2502767b65210b@74.71.26.202:30303+1120", "failures": 0 },
{ "url": "enode://dc30a110a0dbb1146e4ec117fae1207ecafd320b64ffa72b2fa364ad9b1e81eb9567e1cb2c4b73fd420b9cc6ae9becf6e591cf544c2a27c6db505b725ab7ae1c@95.78.158.48:30303", "failures": 0 },
{ "url": "enode://865cda0c7c2fb72f599cb18b364f848a86ea268c1b9b2d871c2214
// now let's rebuild the blooms
if !request.enacted.is_empty() {
let range_start = request.block_number as Number + 1 - request.enacted.len();
let range_end = range_start + request.retracted;
let replaced_range = range_start..range_end;
let enacted_blooms = request.enacted
.iter()
// all traces are expected to be found here. That's why `expect` has been used
// instead of `filter_map`. If some traces haven't been found, it meens that
@tomusdrw
tomusdrw / pubsub-macros.rs
Last active March 6, 2017 16:08
Pub-Sub jsonrpc Macros example proposal
extern crate jsonrpc_core;
extern crate jsonrpc_pubsub;
#[macro_use]
extern crate jsonrpc_macros;
extern crate jsonrpc_tcp_server;
use std::thread;
use std::sync::{atomic, Arc, RwLock};
use std::collections::HashMap;
@tomusdrw
tomusdrw / parity.servers.md
Last active March 14, 2017 15:45
New (web) servers proposal for Parity

Servers summary:

Port: 8545

RPC server & Dapps server

  1. RPC exposed as POST request to any path (except for /api/*)
  2. Validates Host headers and returns proper CORS headers (doesn't process request if CORS is invalid)
  3. When Dapps enabled, additionally: a) Serves network and builtin dapps b) Exposes /api/ and /parity-utils
@tomusdrw
tomusdrw / rpc.md
Created May 4, 2017 13:31
List of RPC methods

Parity RPC methods

Groupped by cause of change of returned value.

Can update with new block:

eth_blockNumber
eth_getBalance(acc, bn)
eth_getStorageAt(acc, idx, bn)
eth_getBlockByNumber(bn, includeTx)
2017-05-18 11:20:37 WARN signer Blocked connection to Signer API from untrusted origin: Some([99, 104, 114, 111, 109, 101, 45, 101, 120, 116, 101, 110, 115, 105, 111, 110, 58, 47, 47, 110, 103, 98, 106, 103, 108, 112, 101, 104, 99, 102, 110, 112, 107, 111, 98, 101, 112, 109, 112, 103, 105, 111, 99, 108, 97, 106, 108, 107, 107, 108, 103])
2017-05-18 11:20:47 WARN signer Blocked connection to Signer API from untrusted origin: Some([99, 104, 114, 111, 109, 101, 45, 101, 120, 116, 101, 110, 115, 105, 111, 110, 58, 47, 47, 110, 103, 98, 106, 103, 108, 112, 101, 104, 99, 102, 110, 112, 107, 111, 98, 101, 112, 109, 112, 103, 105, 111, 99, 108, 97, 106, 108, 107, 107, 108, 103])
2017-05-18 11:20:55 WARN signer Blocked connection to Signer API from untrusted origin: Some([99, 104, 114, 111, 109, 101, 45, 101, 120, 116, 101, 110, 115, 105, 111, 110, 58, 47, 47, 110, 103, 98, 106, 103, 108, 112, 101, 104, 99, 102, 110, 112, 107, 111, 98, 101, 112, 109, 112, 103, 105, 111, 99, 108, 97, 106, 108, 107, 107, 108, 1
Nodejs:
'use strict';
const Hapi = require('hapi');
// Create a server with a host and port
const server = new Hapi.Server();
server.connection({
host: 'localhost',
port: 3002
$ ./target/release/parity --chain=foundatiodb-path /share/__db
Loading config file from /home/tomusdrw/.local/share/io.parity.ethereum/config.toml
2017-09-11 16:10:56 main INFO parity::run Starting Parity/v1.7.2-unstable-3b10e0b-20170830/x86_64-linux-gnu/rustc1.21.0-beta.2
2017-09-11 16:10:56 main INFO parity::run Keys path /home/tomusdrw/.local/share/io.parity.ethereum/keys/Foundation
2017-09-11 16:10:56 main INFO parity::run DB path /share/__db/ethereum/db/906a34e69aec8c0d
2017-09-11 16:10:56 main INFO parity::run Path to dapps /home/tomusdrw/.local/share/io.parity.ethereum/dapps
2017-09-11 16:10:56 main INFO parity::run State DB configuration: fast
2017-09-11 16:10:56 main INFO parity::run Operating mode: passive
2017-09-11 16:10:56 main INFO ethcore::service Configured for Foundation using Ethash engine
2017-09-11 16:10:57 IO Worker #0 INFO network Public node URL: enode://aab61610f7040ffa00fe1af5e243f4a3422dcf479be3a12f8477e778e84b5745d704fdfa7440321884c29b679e9631a978e9ed36d5c52b0d215f6d
This file has been truncated, but you can view the full file.
Loading config file from /home/tomusdrw/.local/share/io.parity.ethereum/config.toml
2017-09-11 17:01:41 main INFO parity::run Starting Parity/v1.7.2-unstable-3b10e0b-20170830/x86_64-linux-gnu/rustc1.21.0-beta.2
2017-09-11 17:01:41 main INFO parity::run Keys path /home/tomusdrw/.local/share/io.parity.ethereum/keys/Foundation
2017-09-11 17:01:41 main INFO parity::run DB path /share/__db/ethereum/db/906a34e69aec8c0d
2017-09-11 17:01:41 main INFO parity::run Path to dapps /home/tomusdrw/.local/share/io.parity.ethereum/dapps
2017-09-11 17:01:41 main INFO parity::run State DB configuration: fast
2017-09-11 17:01:41 main INFO parity::run Operating mode: passive
2017-09-11 17:01:41 main INFO ethcore::service Configured for Foundation using Ethash engine
2017-09-11 17:01:42 IO Worker #0 INFO network Public node URL: enode://aab61610f7040ffa00fe1af5e243f4a3422dcf479be3a12f8477e778e84b5745d704fdfa7440321884c29b679e9631a978e9ed36d5c52b0d215f6d299c762e68@192.168.0.100:30303
2017-09-11 17:01:42 main WARN d

Try to break transaction scheduler

Last one thing is not yet implemented - transactions should be allowed only for certified accounts. (so right now it's possible to spam the service by sending transactions from newly created accounts)

How to do it?