SlideShare a Scribd company logo
1 of 23
Download to read offline
How to Serve Blockchain Data With AWS Lambda
August 17, 2018
2
Assumptions For Time
•Familiar with Blockchains such as
Bitcoin

•Familiar with AWS

•Familiar with Relational and NoSQL
Databases
3
Don’t worry
There is a blog post
https://verypossible.com/blog/how-to-serve-blockchain-data-on-the-web
4
Block Chains are Different
• Data Retrieval via Remote Procedure Calls (RPC)

• Setup and maintain server

• Different from RESTful APIs and managed databases
5
• Unspent Transaction Output (UTXO) Model

• Bitcoin

• No accounts, senders, receivers, etc. Only transactions

• Transactions are formed of inputs and outputs

• Inputs for a transaction are the output of a previous
transaction

• Account Model

• Ethereum

• Accounts can have their own signature verification algorithm

• Allows for Decentralized Apps (dapps)
Transaction Data Structure
6
UTXO Explained By Example
• Alice needs to pay Bob for renting his car

• Both have public/private encryption key pair for signing transactions

• Alice has unspent Bitcoin from Dan

• Alice has 0.25 Bitcoin

• Alice owes Bob 0.1 Bitcoin
7
• Alice signs her UTXO from Dan to prove ownership

• This is the input to the new transaction

• Bob receives 0.1 Bitcoin for the car rental

• Bob can now use this to pay someone else

• Alice receives 0.15 Bitcoin

• This output gives Alice change for paying Bob

• The whole transaction had to be signed
Transferring the Funds
8
The Transaction
{
"version": 1,
"locktime": 0,
"vin": [
{
"txid": "7957a35fe64f80d234d76d83a2a8f1a0d8149a41d81de548f0a65a8a999f6f18",
"vout": 0,
"scriptSig" : “3045022100884d142d86652a3f47ba…[ALL] 0484ecc0d46f1918b30928fa0e4ed99f16a0fb4f…”,
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.15000000,
"scriptPubKey": "OP_DUP OP_HASH160 ab68025513c3dbd2f7b92a94e0581f5d50f654e7 OP_EQUALVERIFY OP_CHECKSIG"
},
{
"value": 0.10000000,
"scriptPubKey": "OP_DUP OP_HASH160 7f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8 OP_EQUALVERIFY OP_CHECKSIG",
}
]
}
9
Remote Procedure Calls (RPC)
• Execute code that is not a part of your program

• Requires the application to be running

• Need to maintain a server to retrieve data
10
• Need to download entire chain on first boot

• For our project and chain this took about 30 minutes

• Need to configure indexes

• Each node has to sync

• Need to protect against catastrophic failure
Standing Up the Blockchain
11
What Documentation?
• Bitcoin and Ethereum have good documentation

• Forked chains, like QTUM, have poor documentation

• Will have to search more for correct documentation
Investing in Mining Operation with Automated Distributions
Recently we were tasked with building an investment management platform for a
cryptocurrency mining service. Clients would send funds to the investment address
and would receive a portion of mining rewards. The system needed to accept
investments from multiple addresses for one client, show them a balance of their
entire investment, allocate a portion of mining rewards to their account, and graph
the balance growth over time. We needed to initially support a web interface and
later support a native mobile application with wallet integration for easier
investment. As always, the service needed the ability to scale to demand and be
highly available.

TheUseCase
12
13
The Architecture
• Serverless API on Lambda written in Python

• PostgreSQL database managed by RDS

• React SPA Deployed to S3 with CloudFront Distribution
14
• Two EC2 instances

• Load Balancer with Auto Scaling Group

• EBS-backed AMI
Adding the Blockchain
15
Automate Everything!
• Packer to create AMI for Blockchain Nodes

• CloudFormation

• Stacker to setup entire infrastructure

• EC2 instances

• Load Balancer with Auto Scaling Groups

• Database with RDS

• Virtual Private Cloud (VPC) for networking

• Serverless to deploy Lambda Functions
16
• Automated testing using CircleCI

• Deployment executes only for Master

• Deploy Lambda Functions

• Execute Database Migrations
Ship It
17
Architecture Overview
18
Lessons Learned
• Lambda is powerful but can be painful in development

• No hot reloading

• Cannot test entire stack locally because of dependency 

on API Gateway

• Debugging is difficult

• CloudWatch logs leave much to be desired

• Lambda Cold Starts
19
• Each Engineer deployed their own Lambda functions

• Only functions that were updated were deployed

• Still had issues with only using one database
How We Reacted
20
Show me the Data
• Connect to the node using python-bitcoinrpc
21
Requesting Data
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
import json
# rpc_user and rpc_password are set in the bitcoin.conf file
rpc = AuthServiceProxy("http://%s:%s@127.0.0.1:8332"%(rpc_user, rpc_password))
payload = {
'addresses': ['INSERT ADDRESS HERE'],
'start': STARTING BLOCK,
'end': ENDING BLOCK,
}
deltas = rpc.getaddressdeltas(json.dumps(payload))
print(deltas)
22
The Result
[
{
"satoshis": 1,
"txid": "TRANSACTION ID",
"index": 2,
"blockindex": 236,
"height": 220151,
"address": "INSERT ADDRESS HERE"
},
{
"satoshis": 30000,
"txid": "TRANSACTION ID",
"index": 0,
"blockindex": 165,
"height": 228208,
"address": "INSERT ADDRESS HERE"
}
]
Thank You
https://verypossible.com/blog/how-to-serve-blockchain-data-on-the-web

More Related Content

What's hot

SignalR: Add real-time to your applications
SignalR: Add real-time to your applicationsSignalR: Add real-time to your applications
SignalR: Add real-time to your applications
Eugene Zharkov
 

What's hot (19)

Matt Chung (Independent) - Serverless application with AWS Lambda
Matt Chung (Independent) - Serverless application with AWS Lambda Matt Chung (Independent) - Serverless application with AWS Lambda
Matt Chung (Independent) - Serverless application with AWS Lambda
 
Build your First IoT Application with IBM Watson IoT
Build your First IoT Application with IBM Watson IoTBuild your First IoT Application with IBM Watson IoT
Build your First IoT Application with IBM Watson IoT
 
SignalR: Add real-time to your applications
SignalR: Add real-time to your applicationsSignalR: Add real-time to your applications
SignalR: Add real-time to your applications
 
Brendon Foxen (Channel 4) - Speeding up Software Delivery at Channel 4
Brendon Foxen (Channel 4) - Speeding up Software Delivery at Channel 4Brendon Foxen (Channel 4) - Speeding up Software Delivery at Channel 4
Brendon Foxen (Channel 4) - Speeding up Software Delivery at Channel 4
 
Cinder Updates - Liberty Edition
Cinder Updates - Liberty Edition Cinder Updates - Liberty Edition
Cinder Updates - Liberty Edition
 
Service Discovery: From Classic to VPC
Service Discovery: From Classic to VPCService Discovery: From Classic to VPC
Service Discovery: From Classic to VPC
 
Introducing Venice
Introducing VeniceIntroducing Venice
Introducing Venice
 
Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes
 
Managing Stateful Services with the Operator Pattern in Kubernetes - Kubernet...
Managing Stateful Services with the Operator Pattern in Kubernetes - Kubernet...Managing Stateful Services with the Operator Pattern in Kubernetes - Kubernet...
Managing Stateful Services with the Operator Pattern in Kubernetes - Kubernet...
 
Dynamic routing in microservice oriented architecture
Dynamic routing in microservice oriented architectureDynamic routing in microservice oriented architecture
Dynamic routing in microservice oriented architecture
 
linkerd: The Cloud Native Service Mesh
linkerd: The Cloud Native Service Meshlinkerd: The Cloud Native Service Mesh
linkerd: The Cloud Native Service Mesh
 
Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture
Devoxx 2018 -  Pivotal and AxonIQ - Quickstart your event driven architectureDevoxx 2018 -  Pivotal and AxonIQ - Quickstart your event driven architecture
Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture
 
Manage your APIs and Microservices with an API Gateway
Manage your APIs and Microservices with an API GatewayManage your APIs and Microservices with an API Gateway
Manage your APIs and Microservices with an API Gateway
 
Integrating Apache Kafka and Elastic Using the Connect Framework
Integrating Apache Kafka and Elastic Using the Connect FrameworkIntegrating Apache Kafka and Elastic Using the Connect Framework
Integrating Apache Kafka and Elastic Using the Connect Framework
 
Service Discovery 101
Service Discovery 101Service Discovery 101
Service Discovery 101
 
Kafka Streams
Kafka StreamsKafka Streams
Kafka Streams
 
Scaling infrastructure beyond containers
Scaling infrastructure beyond containersScaling infrastructure beyond containers
Scaling infrastructure beyond containers
 
Expose BizTalk to the world (ACSUG)
Expose BizTalk to the world (ACSUG)Expose BizTalk to the world (ACSUG)
Expose BizTalk to the world (ACSUG)
 
2019 Lightning Talk: Discovery, Consul and Inversion of Control for the infr...
2019  Lightning Talk: Discovery, Consul and Inversion of Control for the infr...2019  Lightning Talk: Discovery, Consul and Inversion of Control for the infr...
2019 Lightning Talk: Discovery, Consul and Inversion of Control for the infr...
 

Similar to How to Serve Blockchain Data with AWS Lambda

Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache Thrift
RX-M Enterprises LLC
 

Similar to How to Serve Blockchain Data with AWS Lambda (20)

Serverless Node.js
Serverless Node.jsServerless Node.js
Serverless Node.js
 
Kubernetes Networking 101 kubecon EU 2022
Kubernetes Networking 101 kubecon EU 2022Kubernetes Networking 101 kubecon EU 2022
Kubernetes Networking 101 kubecon EU 2022
 
NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013
 
ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...
ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...
ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...
 
Collecting 600M events/day
Collecting 600M events/dayCollecting 600M events/day
Collecting 600M events/day
 
99cloud Docker Training module 2
99cloud Docker Training module 299cloud Docker Training module 2
99cloud Docker Training module 2
 
The Operator Pattern - Managing Stateful Services in Kubernetes
The Operator Pattern - Managing Stateful Services in KubernetesThe Operator Pattern - Managing Stateful Services in Kubernetes
The Operator Pattern - Managing Stateful Services in Kubernetes
 
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
 
REDSHIFT - Amazon
REDSHIFT - AmazonREDSHIFT - Amazon
REDSHIFT - Amazon
 
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
 
Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache Thrift
 
Asynchronous design with Spring and RTI: 1M events per second
Asynchronous design with Spring and RTI: 1M events per secondAsynchronous design with Spring and RTI: 1M events per second
Asynchronous design with Spring and RTI: 1M events per second
 
Grails in the Cloud (2013)
Grails in the Cloud (2013)Grails in the Cloud (2013)
Grails in the Cloud (2013)
 
Going Serverless - an Introduction to AWS Glue
Going Serverless - an Introduction to AWS GlueGoing Serverless - an Introduction to AWS Glue
Going Serverless - an Introduction to AWS Glue
 
How to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless EditionHow to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless Edition
 
GraphQL API on a Serverless Environment
GraphQL API on a Serverless EnvironmentGraphQL API on a Serverless Environment
GraphQL API on a Serverless Environment
 
How to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless EditionHow to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless Edition
 
The Need of Cloud-Native Application
The Need of Cloud-Native ApplicationThe Need of Cloud-Native Application
The Need of Cloud-Native Application
 
AWS Lambda Function with Kotlin
AWS Lambda Function with KotlinAWS Lambda Function with Kotlin
AWS Lambda Function with Kotlin
 
OpenStack and Windows
OpenStack and WindowsOpenStack and Windows
OpenStack and Windows
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

How to Serve Blockchain Data with AWS Lambda

  • 1. How to Serve Blockchain Data With AWS Lambda August 17, 2018
  • 2. 2 Assumptions For Time •Familiar with Blockchains such as Bitcoin •Familiar with AWS •Familiar with Relational and NoSQL Databases
  • 3. 3 Don’t worry There is a blog post https://verypossible.com/blog/how-to-serve-blockchain-data-on-the-web
  • 4. 4 Block Chains are Different • Data Retrieval via Remote Procedure Calls (RPC) • Setup and maintain server • Different from RESTful APIs and managed databases
  • 5. 5 • Unspent Transaction Output (UTXO) Model • Bitcoin • No accounts, senders, receivers, etc. Only transactions • Transactions are formed of inputs and outputs • Inputs for a transaction are the output of a previous transaction • Account Model • Ethereum • Accounts can have their own signature verification algorithm • Allows for Decentralized Apps (dapps) Transaction Data Structure
  • 6. 6 UTXO Explained By Example • Alice needs to pay Bob for renting his car • Both have public/private encryption key pair for signing transactions • Alice has unspent Bitcoin from Dan • Alice has 0.25 Bitcoin • Alice owes Bob 0.1 Bitcoin
  • 7. 7 • Alice signs her UTXO from Dan to prove ownership • This is the input to the new transaction • Bob receives 0.1 Bitcoin for the car rental • Bob can now use this to pay someone else • Alice receives 0.15 Bitcoin • This output gives Alice change for paying Bob • The whole transaction had to be signed Transferring the Funds
  • 8. 8 The Transaction { "version": 1, "locktime": 0, "vin": [ { "txid": "7957a35fe64f80d234d76d83a2a8f1a0d8149a41d81de548f0a65a8a999f6f18", "vout": 0, "scriptSig" : “3045022100884d142d86652a3f47ba…[ALL] 0484ecc0d46f1918b30928fa0e4ed99f16a0fb4f…”, "sequence": 4294967295 } ], "vout": [ { "value": 0.15000000, "scriptPubKey": "OP_DUP OP_HASH160 ab68025513c3dbd2f7b92a94e0581f5d50f654e7 OP_EQUALVERIFY OP_CHECKSIG" }, { "value": 0.10000000, "scriptPubKey": "OP_DUP OP_HASH160 7f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8 OP_EQUALVERIFY OP_CHECKSIG", } ] }
  • 9. 9 Remote Procedure Calls (RPC) • Execute code that is not a part of your program • Requires the application to be running • Need to maintain a server to retrieve data
  • 10. 10 • Need to download entire chain on first boot • For our project and chain this took about 30 minutes • Need to configure indexes • Each node has to sync • Need to protect against catastrophic failure Standing Up the Blockchain
  • 11. 11 What Documentation? • Bitcoin and Ethereum have good documentation • Forked chains, like QTUM, have poor documentation • Will have to search more for correct documentation
  • 12. Investing in Mining Operation with Automated Distributions Recently we were tasked with building an investment management platform for a cryptocurrency mining service. Clients would send funds to the investment address and would receive a portion of mining rewards. The system needed to accept investments from multiple addresses for one client, show them a balance of their entire investment, allocate a portion of mining rewards to their account, and graph the balance growth over time. We needed to initially support a web interface and later support a native mobile application with wallet integration for easier investment. As always, the service needed the ability to scale to demand and be highly available. TheUseCase 12
  • 13. 13 The Architecture • Serverless API on Lambda written in Python • PostgreSQL database managed by RDS • React SPA Deployed to S3 with CloudFront Distribution
  • 14. 14 • Two EC2 instances • Load Balancer with Auto Scaling Group • EBS-backed AMI Adding the Blockchain
  • 15. 15 Automate Everything! • Packer to create AMI for Blockchain Nodes • CloudFormation • Stacker to setup entire infrastructure • EC2 instances • Load Balancer with Auto Scaling Groups • Database with RDS • Virtual Private Cloud (VPC) for networking • Serverless to deploy Lambda Functions
  • 16. 16 • Automated testing using CircleCI • Deployment executes only for Master • Deploy Lambda Functions • Execute Database Migrations Ship It
  • 18. 18 Lessons Learned • Lambda is powerful but can be painful in development • No hot reloading • Cannot test entire stack locally because of dependency 
 on API Gateway • Debugging is difficult • CloudWatch logs leave much to be desired • Lambda Cold Starts
  • 19. 19 • Each Engineer deployed their own Lambda functions • Only functions that were updated were deployed • Still had issues with only using one database How We Reacted
  • 20. 20 Show me the Data • Connect to the node using python-bitcoinrpc
  • 21. 21 Requesting Data from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException import json # rpc_user and rpc_password are set in the bitcoin.conf file rpc = AuthServiceProxy("http://%s:%s@127.0.0.1:8332"%(rpc_user, rpc_password)) payload = { 'addresses': ['INSERT ADDRESS HERE'], 'start': STARTING BLOCK, 'end': ENDING BLOCK, } deltas = rpc.getaddressdeltas(json.dumps(payload)) print(deltas)
  • 22. 22 The Result [ { "satoshis": 1, "txid": "TRANSACTION ID", "index": 2, "blockindex": 236, "height": 220151, "address": "INSERT ADDRESS HERE" }, { "satoshis": 30000, "txid": "TRANSACTION ID", "index": 0, "blockindex": 165, "height": 228208, "address": "INSERT ADDRESS HERE" } ]